function GetUglyNumber_Solution(index)
{
    // write code here
    if(index === 0) return 0
    let res = [1]
    let p2 = 0,
        p3 = 0,
        p5 = 0
    for(let i = 1;i <= index;i++){
      let newNum = Math.min(res[p2]*2,res[p3]*3,res[p5]*5)
      res.push(newNum)
      if(newNum === res[p2]*2) p2++
      if(newNum === res[p3]*3) p3++
      if(newNum === res[p5]*5) p5++
    }
    return res[index-1]
}
module.exports = {
    GetUglyNumber_Solution : GetUglyNumber_Solution
};